package com.beiding.businessplatform.ql;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

class BuilderHolder {


    private Map<String, Object> params = new HashMap<>();

    private StringBuilder selectBuilder = new StringBuilder();

    private int i = 0;

    String addSet(Object value) {
        String key = "p" + (++i);
        params.put(key, value);
        return key;
    }

    BuilderHolder appendSelect(String t) {
        selectBuilder.append(t);
        return this;
    }

    Map<String, Object> getParams() {
        return params;
    }

    private StringBuilder whereBuilder = new StringBuilder();

    BuilderHolder appendWhere(String t) {
        whereBuilder.append(t);
        return this;
    }

    public String getSelect() {
        return selectBuilder.toString();
    }

    public String getWhere() {
        return whereBuilder.toString();
    }

}
